//
//  ConfigurationCodeing.m
//  ERP
//
//  Created by goldeney on 15/5/7.
//  Copyright (c) 2015年 ShangHai Goldeneye Techonology Co.,Ltd. All rights reserved.
//

#import "ConfigurationCodeing.h"

#define kIpAddress            @"IpAddress"
#define kOrganization         @"organization"
#define kBriefCode            @"briefCode"
#define kServerType           @"serverType"

@implementation ConfigurationCodeing
@synthesize IpAddress;
@synthesize organization;
@synthesize briefCode;
@synthesize serverType;

#pragma mark -
#pragma mark NSCoding

-(void)encodeWithCoder:(NSCoder *)aCoder{//编码
    [aCoder encodeObject:IpAddress forKey:kIpAddress];
    [aCoder encodeObject:organization forKey:kOrganization];
    [aCoder encodeObject:briefCode forKey:kBriefCode];
    [aCoder encodeObject:serverType forKey:kServerType];
}

-(id)initWithCoder:(NSCoder *)aDecoder{//解码
    self = [super init];
    if(self){
        IpAddress = [aDecoder decodeObjectForKey:kIpAddress];
        organization = [aDecoder decodeObjectForKey:kOrganization];
        briefCode = [aDecoder decodeObjectForKey:kBriefCode];
        serverType = [aDecoder decodeObjectForKey:kServerType];
    }
    return self;
}

#pragma mark -
#pragma mark NSCopying

-(id)copyWithZone:(NSZone *)zone{
    ConfigurationCodeing *userInfo = [[[self class] allocWithZone:zone] init];
    userInfo.IpAddress = [self.IpAddress copyWithZone:zone];
    userInfo.organization = [self.organization copyWithZone:zone];
    userInfo.briefCode = [self.briefCode copyWithZone:zone];
    userInfo.serverType = [self.serverType copyWithZone:zone];
    return userInfo;
}

@end
